package com.zyy.proxy.demo03;

/**
 * @Description: 类描述
 * @Author: zyy
 * @Date: 2023/07/26 22:49
 */
public class UserService {
    public static void main(String[] args) {
        //真实角色
        UserDao userDao = new UserDaoImpl();
        //代理角色
        ProxyInvocationHandle proxyInvocationHandle = new ProxyInvocationHandle();
        //设置要代理的对象
        proxyInvocationHandle.setObj(userDao);
        //动态生成代理类
        UserDao proxy = (UserDao) proxyInvocationHandle.getProxy();
        proxy.add();
    }
}
